// 过滤器 对元素数据进行处理
// 定义过滤器
Vue.filter('toGender',function (value) {
   return value ? '男':'女';
});
let app = new Vue({
    el:'#root',
    data:{
    userData:Mock.mock({'data|10':[{
    name:'@cname',
    gender:'@boolean',
    city:'@city',
    phoneNumber:/^1[35789]\d{9}$/,
    age:'@integer(16,30)'
    }]}).data,
    msg:'hello,world!',
    htmlTag:'<h2>11223434556</h2>',
    username:'',
    isLogIn:false,
    href:'https://www.baidu.com',
    hrefName:'baidu',
    isActive:true,
    d:'active'
    },
    methods:{
        clickToDel(index){
          this.userData.splice(index,1);
        },
        fn(){
        console.log(this.username);
        }
    }
});
